<?php
$con = mysqli_connect(
    "127.0.0.1",
    "root",
    "310831",
    "fatie"
);

//自动生成时间
date_default_timezone_set('Asia/Shanghai');
$time = date('Y-m-d H:i:s');

$sql_insert = "INSERT INTO demo01 VALUES('$_POST[ID]','$_POST[username]',CURRENT_TIMESTAMP,'$_POST[remark]')";


if (!mysqli_query($con, $sql_insert)) {
    die('插入数据失败' . mysqli_error($con));
} else {
    echo "<br>";
    echo "<script> alert('数据插入成功');
      window.location.href = 'index.html' </script>";
}


